package cz.data.common.redis.config;

import java.time.Duration;

public class CacheNames {

    public static final String CACHE_10MIN = "CACHE_10MIN";
    public static final String CACHE_15MIN = "CACHE_15MIN";
    public static final String CACHE_30MIN = "CACHE_30MIN";
    public static final String CACHE_1HOUSE = "CACHE_1HOUSE";
    public static final CacheName[] CACHE_NAMES = {
            CacheName.CACHE_10MIN,
            CacheName.CACHE_15MIN,
            CacheName.CACHE_30MIN,
            CacheName.CACHE_1HOUSE,
    };

    public enum CacheName {
        CACHE_10MIN(CacheNames.CACHE_10MIN, Duration.ofMinutes(10)),
        CACHE_15MIN(CacheNames.CACHE_15MIN, Duration.ofMinutes(15)),
        CACHE_30MIN(CacheNames.CACHE_30MIN, Duration.ofMinutes(30)),
        CACHE_1HOUSE(CacheNames.CACHE_1HOUSE, Duration.ofHours(1));

        private final String name;
        private final Duration duration;

        CacheName(String name, Duration duration) {
            this.name = name;
            this.duration = duration;
        }

        public String getName() {
            return name;
        }

        public Duration getDuration() {
            return duration;
        }
    }
}
